package com.example.demo.service.impl;

import com.example.demo.entity.User;
import com.example.demo.mapper.AdminMapper;
import com.example.demo.entity.Info;
import com.example.demo.entity.Report;
import com.example.demo.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public List<Info> findAllReport() {
        List<Info> list = adminMapper.findAllReport();
        return list;
    }

    @Override
    public Info findAReportInfo(int id) {
        Info info = adminMapper.findAReportInfo(id);
        return info;
    }

    @Override
    public Report findAReportContent(int id) {
        Report report = adminMapper.findAReportContent(id);
        return report;
    }

    @Override
    public int deleteAInfo(int id) {
        int i = adminMapper.deleteAInfo(id);
        return i;
    }

    @Override
    public int bannedUser(String username2) {
        int i = adminMapper.bannedUser(username2);
        return i;
    }

    @Override
    public int unbannedUser(String username2) {
        int i = adminMapper.unbannedUser(username2);
        return i;
    }

    @Override
    public List<User> findAllUnban() {
        List<User> list = adminMapper.findAllUnban();
        return list;
    }

    @Override
    public List<User> findAllBan() {
        List<User> list = adminMapper.findAllBan();
        return list;

    }

    @Override
    public int deleteAReport(int id) {
        int i = adminMapper.deleteAReport(id);
        return i;
    }
}
